const express = require('express');
const router = express.Router();

//挂载路由

//导入路由处理模块
const userinfo_handle = require('../router_handler/userinfo');

//导入验证数据的中间件
const expressJoi = require('@escook/express-joi');
//导入需要的验证规则对象
const { update_Userinfo_Schema, update_Avater_Schema, update_Password_Schema } = require('../schema/user');

//获取用户基本信息的路由
router.get('/userinfo', userinfo_handle.getUserInfo);
//更新用户信息
router.post('/userinfo', expressJoi(update_Userinfo_Schema), userinfo_handle.updateUserInfo);
//更新密码的功能
router.post('/updatepwd', expressJoi(update_Password_Schema), userinfo_handle.updatePassword);
//更新头像的路由
router.post('/update/avatar', expressJoi(update_Avater_Schema), userinfo_handle.updateAvatar);


module.exports = router;